package com.jinyu.dao.entity;

import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * @Author: yangli
 * @Despriction:    测试实体类
 * @Package: com.jinyu.admin.entity
 * @Date:Created in 2022/5/2 0:10
 * @Modify By:
 */
public class TestEntity {

    /**
     *  主键id
     */
    private long id;

    /**
     *  名称
     */
    @NotNull(message = "名称参数不能空")
    @Length(min = 2,max = 6,message = "名称长度在2到6之间")
    private String name;

    /**
     *  年龄
     */
    private int age;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "TestEntity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
